package com.zzb.listener;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Slf4j
public class ProductMQListener {
    @RabbitListener(queues = "zzb_product")
    public void productReceive(String message, @Payload String body, @Headers Map headers) {
        log.info("payload:{}", body);
        log.info("headers:{}", headers);
        log.info("product收到消息，消息内容是: {}", message);
    }
}
